<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp" %>
<!DOCTYPE HTML>
<html ng-app>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
    <title>${title}</title>
    <%@ include file="/WEB-INF/jsp/commons/meta.jsp" %>
    <link href="${ctx}/resources/new/style.css" type="text/css" rel="stylesheet"/>

</head>
<body>
<style>
    .tab-content {
        border: 1px solid #E3E3E3;
        border-radius: 0px 0px 4px 4px;
        border-top: none;
        padding: 2px;
    }
</style>
<script type="text/javascript">
    <!--
    $(function () {
        // 日期控件
        $(".datepicker").datepicker({
            dateFormat: "yy-mm-dd",
            monthNames: [ "- 01月", "- 02月", "- 03月", "- 04月", "- 05月", "- 06月", "- 07月", "- 08月", "- 09月", "- 10月", "- 11月", "- 12月" ],
            showMonthAfterYear: true
        });
    })
    //-->
</script>
<ul class="nav nav-tabs tab tBlock">
    <li class="active">
        <a deny="not" class="nFocus" href="#single" data-toggle="tab">
            <i class="icon-tags"></i>
            库存明细
        </a>
    </li>
    <li>
        <a deny="not">
            <span> ${m.name } - ${m.spcification } - 明细 </span>
        </a>
    </li>
    <li style="float: right;">
        <a href="${ctx}/adoms/goods/myStock">
            <i class="icon-arrow-left"></i>
            返回
        </a>
    </li>
</ul>

<div class="tab-content" style="margin-top: -20px; padding: 10px;">
    <div class="tab-pane active" id="single">
        <!-- 分页显示演示开始 -->
        <form id="listForm" class="well form-search" action="${ctx }/adoms/stockDetail/list/${m.id}" method="post">
            <input type="hidden" name="pageNo" id="pageNo" value="${pageData.pagination.pageNo}"/>
            <input type="hidden" name="fieldName" id="fieldName" value="${pageData.compositor.fieldName}"/>
            <input type="hidden" name="compositorType" id="compositorType"
                   value="${pageData.compositor.compositorType}"/>
            <table class="table table-striped table-bordered table-condensed">
                <tr align="center">
                    <th>
						<span class="pull-left">
							日期：从
							<y:search fieldType="D" className="datepicker" fieldList="insertTime" matchType="GE"/>
							到
							<y:search fieldType="D" className="datepicker" fieldList="insertTime" matchType="LE"/>
							<button class="btn btn-small" onclick="search()" type="button">
                                <i class="icon-search"></i>
                                搜索
                            </button>
						</span>
                    </th>
                </tr>
            </table>
        </form>
        <table class="table">
            <tr>
                <th>#</th>
                <th>
                    <a href="javascript:sort('insertTime')">日期</a>
                </th>
                <th>
                    <a href="javascript:sort('tgDepartment')">对象</a>
                </th>
                <th>
                    <a href="javascript:sort('action')">动作</a>
                </th>
                <th>
                    <a href="javascript:sort('number')">数量(${m.packageing })</a>
                </th>
                <th>
                    <a href="javascript:sort('numberOfBox')">数量(件)</a>
                </th>
                <th>
                    <a href="javascript:sort('leftNumberOfBox')">余额(件)</a>
                </th>
            </tr>
            <c:forEach var="detail" items="${pageData.result }" varStatus="i">
                <tr>
                    <td>${i.index + 1 }</td>
                    <td>${detail.insertTime }</td>
                    <td>${detail.tgDepartment.name}</td>
                    <td>${detail.action }</td>
                    <td>
                        <fmt:formatNumber pattern="###,##0.00">${detail.number }</fmt:formatNumber>
                    </td>
                    <td>
                        <fmt:formatNumber pattern="###,##0.00">${detail.numberOfBox }</fmt:formatNumber>
                    </td>
                    <td>
                        <fmt:formatNumber pattern="###,##0.00">${detail.leftNumberOfBox }</fmt:formatNumber>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <%@ include file="/WEB-INF/jsp/commons/pager.jsp" %>
    </div>
</div>
</body>
</html>